package com.service.impl;

import com.dao.EmployeeDao;
import com.pojo.Employee;
import com.service.EmployeeService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
public class EmployeeServiceImpl implements EmployeeService {

    @Autowired
    EmployeeDao employeeDao;

    @Transactional
    @Override
    public List<Employee> FindAllEmployee() {
        System.out.println("进入FindAllEmployee.....");
        return employeeDao.FindAllEmployee("楼栋管理员");
    }

    @Transactional
    @Override
    public Integer DeleteEmployee(String username) {
        return employeeDao.deleteEmployee(username);
    }

    @Transactional
    @Override
    public Integer AddEmployee(String username,String password) {
        return employeeDao.AddEmployee(username,password);
    }
}
